package Computer.Main;


public class LongMemory extends Memory {
		
	private final long size;
	
	public LongMemory(long size) {
		
		this.size = size;

		for(int i=0;i<size;i++) { 
			this.dataWords.add(new LongWord(0));
		}
	}
	
	public DataWord get(Address a) {
		if(a.value() >= size)
			throw new ArrayIndexOutOfBoundsException();
		return dataWords.get(a.value());
	}
	public void set(Address a, Pointer dw) {
		dataWords.set(a.value(), dw.getWord(this));
	}
}
